<template>
  <div>
    <a-button icon="setting" @click="openFomMenuSearchQuery" shape="round">点击设置</a-button>
    <FormMenuSearchQuery ref="FormMenuSearchQuery" @ok="ok"/>
  </div>
</template>
<script>
import FormMenuSearchQuery from '@/components/hhd/design/FormMenu/FormMenuSearchQuery.vue';
import {createModelForVue, createProps} from '@/utils';
import {createFormDefinition, createFormMenu} from '@/components/hhd/design/FormDesigner/types';

export default {
  name: 'FormMenuSearchQuerys',
  components: {FormMenuSearchQuery},
  model: createModelForVue('searchQuerys'),
  props: {
    searchQuerys: createProps(Array),
    formDefinition: createProps(Object, createFormDefinition),
  },
  methods: {
    openFomMenuSearchQuery() {
      this.$refs.FormMenuSearchQuery.setData(this.searchQuerys, this.formDefinition);
    },
    ok(searchQuerys) {
      this.$emit('change', searchQuerys);
    },
  }
}
</script>